package jmir.oscar.panell.figures;

public abstract class Figura2D {

	protected final Color colorFondo;
	protected final Color colorBorde;
	protected final int anchoBorde;
	protected int coordenadaX;
	protected int coordenadaY;
	
	public Figura2D(int coordenadaX, int coordenadaY, Color colorFondo, Color colorBorde, int anchoBorde) {
		super();
		this.colorFondo = colorFondo;
		this.colorBorde = colorBorde;
		this.anchoBorde = anchoBorde;
		this.coordenadaX = coordenadaX;
		this.coordenadaY = coordenadaY;
	}

	public Figura2D(Color colorFondo, Color colorBorde, int anchoBorde) {
		super();
		this.colorFondo = colorFondo;
		this.colorBorde = colorBorde;
		this.anchoBorde = anchoBorde;
	}
	

	public Figura2D() {
		super();
		this.colorFondo = Color.BLANC;
		this.colorBorde = Color.NEGRE;
		this.anchoBorde = 1;
	}

	public int getAnchoBorde() {
		return anchoBorde;
	}
	
	public int getCoordenadaX() {
		return coordenadaX;
	}

	public void setCoordenadaX(int coordenadaX) {
		this.coordenadaX = coordenadaX;
	}

	public int getCoordenadaY() {
		return coordenadaY;
	}

	public void setCoordenadaY(int coordenadaY) {
		this.coordenadaY = coordenadaY;
	}

	
	public Color getColorFondo() {
		return colorFondo;
	}

	public Color getColorBorde() {
		return colorBorde;
	}

	
	// Abstractes: Han de ser implementades en les clases filles
	public abstract double calculaPerimetre();
	
	public abstract double calculaSuperficie();
	
	public abstract int hashCode();
	
	public abstract boolean equals(Object obj);
}
